package com.rem.designPattern.flyweight享元;

/**
 * @author Rem
 * @date 2022-11-18
 */
public class Client {
    public static void main(String[] args) {
        WebsiteFactory.getWebsiteCategory(Type.news).use(new User("Tom"));
        WebsiteFactory.getWebsiteCategory(Type.blog).use(new User("Jerry"));
        User john = new User("John");
        WebsiteFactory.getWebsiteCategory(Type.blog).use(john);
        WebsiteFactory.getWebsiteCategory(Type.weChat_official_account).use(john);

        System.out.println("网站个数:" + WebsiteFactory.getSize());
    }
}